<template>
  <div class="welcomeBox" style="width:99%;margin-top:-25px;">
    <!-- <nav-Bar></nav-Bar> -->
    <div class="welcome">欢迎使用101CRM客户管理系统</div>
    <div class="routerList">
        <ul class="menu-sub">
            <li v-for="(item2, idx) in navTree" :key="idx">
              <router-link :to="item2.menuUrl">{{item2.menuName}}</router-link>
            </li>
          </ul>
    </div>
    <router-view   class="content"></router-view>
  </div>
</template>

<script>
import navBar from '../components/navBar'
import MainContent from "../components/MainContent"
  export default {
    components:{
      navBar,
      MainContent
    },
    data(){
      return{
        navTree:[]
      }
    },
    methods :{
      get_router(){

      this.$api.menu.findNavTree({"authType":1,"useObject":'1',"userName":this.userName}).then(res=>{
        let newArry=[]
        res.authorityList.forEach(item=>{
          if(item.menuName=='我的客户(移动端)'||item.menuName=='商务合作中心(移动端)'){
            item.children.forEach(j=>{
              newArry.push(j)
            })
          }
        })
        this.navTree=newArry
      })
    }
    },
    mounted() {
      this.get_router()
    document.body.className='welcomeBox'
  }
  }
</script>

<style lang='scss' scoped>  
.welcomeBox{
  width:100vw !important;
  height:100vh;
  background:linear-gradient(180deg,rgba(0,103,255,1) 0%,rgba(43,181,255,1) 100%);
  margin: 0!important;
  padding-top: 2.84rem;
  .welcome{
    width:6.88rem;
    margin: 0 auto;
    font-size:0.85rem;
    font-family:MicrosoftYaHei;
    color:rgba(255,255,255,1);
  }
  .routerList{
    margin-top: 2.7rem;
    .menu-sub{
      padding-left: 0px;
      li{
        list-style: none;
        color: #fff;
        width:6.3rem;
        height:1.2rem;
        line-height: 1.2rem;
        margin: 0 auto;
        background:rgba(255,255,255,1);
        border-radius:0.75rem;
        text-align: center;
        margin-bottom: 20px;
        a{
          text-decoration: none;
            font-size:0.64rem;
        font-family:MicrosoftYaHei;
        color:rgba(45,131,255,1);
        }
      }
    }   
  }
  #app{
  margin-top: 20px !important;
  }
}
</style>
<style lang="scss">
.welcomeBox{
  #app{
  margin-top: 20px !important;
  }
}
body{
  margin: 0;
}
</style>
